package com.fanrenqiji.modules.sys.web;

import org.apache.shiro.authz.annotation.RequiresUser;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author lijian E-mail:ljz0721cx@163.com
 * @version 创建时间：2015年2月3日 下午6:04:00
 * @description 自定义标签Controller
 */
@Controller
@RequestMapping(value = "${adminPath}/tag")
public class TagController {
	/**
	 * 树结构选择标签（treeselect.tag）
	 * 
	 * @param request
	 * @param model
	 * @return
	 */
	@RequiresUser
	@RequestMapping(value = "treeselect")
	public String treeselect(HttpServletRequest request, Model model) {
		// 树结构数据URL
		model.addAttribute("url", request.getParameter("url"));
		// 排除的编号ID
		model.addAttribute("extId", request.getParameter("extId"));
		// 是否可复选
		model.addAttribute("checked", request.getParameter("checked"));
		// 指定默认选中的ID
		model.addAttribute("selectIds", request.getParameter("selectIds"));
		// 过滤栏目模型
		model.addAttribute("module", request.getParameter("module"));
		return "modules/sys/tagTreeselect";
	}

	/**
	 * 图标选择标签（iconselect.tag）
	 * 
	 * @param request
	 * @param model
	 * @return
	 */
	@RequiresUser
	@RequestMapping(value = "iconselect")
	public String iconselect(HttpServletRequest request, Model model) {
		model.addAttribute("value", request.getParameter("value"));
		return "modules/sys/tagIconselect";
	}
}
